package sevenbits.it;

import dao.Factory;
import model.Chair;
import model.Group;
import model.Student;
//import org.springframework.context.ApplicationContext;
//import org.springframework.context.support.ClassPathXmlApplicationContext;
//import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Collection;
import java.util.Iterator;


public class App {
    public static void main(String[] args) {

        Collection  students =  Factory.getInstance().getStudentDao().getAllStudents();
        Iterator it = students.iterator();
        while (it.hasNext()){
            Student student = (Student) it.next();
            System.out.print(student.getFirst_name() +" ");
            System.out.print(student.getLast_name() +" ");
            System.out.print(student.getChair().getName()+" ");
            System.out.print(student.getGroup().getName()+" ");
            System.out.print(student.getGroup().getFaculty().getName()+" ");
            System.out.println("");


        }

       System.out.println("1");
//           ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
//
//        HelloWorld obj= (HelloWorld)  context.getBean("helloBean");
//        obj.Hello("7bits");

    }
}
